<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
		<li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
				<!-- 头部 -->
				<form ng-submit="searchRe()" class="form-horizontal">
					<div class="form-group">
						<div class="col-sm-2">
							<input type="text" class="form-control" placeholder="用户ID" ng-model="param.userId">
						</div>

						<div class="col-sm-2">
							<select class="form-control" ng-model="param.creditAcctType">
								<option value="">全部账户类型</option>
								<option value="1">广告主</option>
								<option value="2">流量主</option>
							</select>
						</div>

						<div class="col-sm-2">
							<input type="text" id="crateStartdate"  placeholder="创建开始时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
						</div>
						<div class="col-sm-2">
							<input type="text" id="crateEnddate" placeholder="创建结束时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
						</div>

						<div class="col-sm-2">
							<select class="form-control" ng-model="param.state">
								<option value="">全部账户状态</option>
								<option value="V">正常</option>
								<option value="S">休眠</option>
								<option value="C">注销</option>
							</select>
						</div>

						<div class="col-sm-2">
							<input type="text" class="form-control" placeholder="联系人名称" ng-model="param.userName">
						</div>
					</div>

					<div class="form-group">
						<div class="row" align="center">
							<div class="col-md-1">
								<label class="col-sm-1 control-label"><button class="ifc-btn btn-primary" type="submit">查 询</button></label>
							</div>
							<div class="col-md-1">
								<label class="col-sm-1 control-label"><button class="ifc-btn btn-dark" ng-click="clearSearch()">清 空</button></label>
							</div>
						</div>
					</div>
				</form>
			</div>
			<!-- 数据表格 -->
			<div class="table-responsive">
				<table class="table table-striped b-t b-light text-center">
					<thead>
					<tr>
						<th>全选</th>
						<th>编号</th>
						<th>用户ID</th>
						<th>企业名称</th>
						<th>类型</th>
						<th>联系人</th>
						<th>联系方式</th>
						<th>余额</th>
						<th>冻结金额</th>
						<th>创建人<br/>
						创建时间
						</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					<tr ng-repeat="item in pageInfo.records">
						<td class="v-middle"><input ng-model="subCheckBox" type="checkbox"/>{{item.id}}</td>
						<td class="v-middle">{{$index + 1}}</td>
						<td class="v-middle">{{item.userIds}}</td>
						<td class="v-middle">{{item.companyName}}</td>
						<td class="v-middle">
							<span ng-if="item.creditAcctType=='1'">广告主</span>
							<span ng-if="item.creditAcctType=='2'">流量主</span>
							</td>
						<td class="v-middle">
							{{item.userName}}
						</td>
						<td class="v-middle">
							{{item.mobile}}<br/>
							{{item.email}}
						</td>
						<td class="v-middle">{{item.blance}}</td>
						<td class="v-middle">{{item.frozenTotal}}</td>
						<td class="v-middle">
							{{item.userName}}<br/>
							{{item.createDate | date:'yyyy-MM-dd HH:mm:ss'}}
						</td>
						<td class="v-middle">
							<span ng-if="item.state=='V'">正常</span>
							<span ng-if="item.state=='S'" class="text-danger">休眠</span>
							<span ng-if="item.state=='C'" class="text-success">注销</span>
						</td>
						<td class="left">
							<button type="button" ui-sref="main.finance.tradeFlow.list({userIds:item.userIds})" style="width: 60px;margin-right: 5px" class="btn btn-sm btn-danger col-md-1 col-md-offset-1">
							流水</button>
							<button type="button" ng-if="item.creditAcctType=='1' && item.state=='V'" ng-click="showChongz(item.companyName,item.userIds,item.creditAcctType)" style="width: 60px;"  class="btn btn-sm btn-primary col-md-1">
								充值</button>
							<button type="button" ng-if="item.creditAcctType=='1' && item.state=='V'" ng-click="showBackCash(item)" style="width: 60px;"  class="btn btn-sm col-md-1">
								冲销</button>
							<!--<button type="button" ng-if="item.creditAcctType=='2' && item.state=='V'" ng-click="showCash(item.blance,item.companyName,item.creditAcctId,item.creditAcctType,item.userIds)"    class="">-->
								<!--<i class="fa fa-ban m-r-xs text-sm"></i>提现</button>-->
						</td>
					</tr>
					</tbody>
				</table>
			</div><!-- /.table-responsive -->

            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
		</div><!-- /.panel -->
	</div><!-- /.wrapper-data -->
	<form id="saveRecharge">
	<div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="chongz" role="dialog" aria-labelledby="gridSystemModalLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="gridSystemModalLabel">快速充值申请</h4>
				</div>
				<div class="modal-body" id="RechargeBody">

					<div class="row">
						<label class="col-sm-2 control-label text-right">企业名称:</label>
						<label class="col-sm-4">{{recharge.userName}}</label>

						<label class="col-sm-2 control-label text-right">充值金额:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require number" id="czmoney" data-min="0" data-title="充值金额" name="money" placeholder="充值金额" ng-model="recharge.money">
						</div>
					</div>
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">付款方式:</label>
						<div class="col-sm-4">
							<select class="form-control require" name="method" data-title="付款方式" ng-model="recharge.method">
								<option value="">请选择付款方式</option>
								<!--<option value="01">支付宝</option>-->
								<!--<option value="02">财付通</option>-->
								<option value="3">银行转账</option>
								<!--<option value="04">现金</option>-->
							</select>
						</div>
						<label class="col-sm-2 control-label text-right">收款人账户:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" data-title="收款人账户" name="account" placeholder="收款人账户" ng-model="recharge.account">
						</div>
					</div>
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">开户行:</label>
						<div class="col-sm-4">
							<select class="form-control require" name="bank" data-title="开户行" ng-model="recharge.bank">
								<option value="">请选择开户行</option>
								<option ng-repeat="item in banklist" value="{{item.bankCode}}">
									{{item.bankName}}
								</option>


							</select>
						</div>

						<label class="col-sm-2 control-label text-right">交易流水号:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" name="tradeNo" data-title="交易流水号" placeholder="交易流水号" ng-model="recharge.tradeNo">
						</div>


					</div>
					<p></p>
					<div class="row">

						<label class="col-sm-2 control-label text-right">收款单位/个人:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" name="info" placeholder="请输入收款单位/个人信息" data-title="请输入收款单位/个人信息" ng-model="recharge.info">
						</div>

						<label class="col-sm-2 control-label text-right">计划打款日期:</label>
						<div class="col-sm-4">
							<input type="text"   placeholder="计划打款日期" name="czdate" id="czdate" class="form-control require"  data-title="计划打款日期" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
						</div>
					</div>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" ng-click="saveRecharge()">确定</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
	</form>

	<form id="saveApply" name="saveApply">
	<div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="cash" role="dialog" aria-labelledby="CashLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="CashLabel">快速提现申请</h4>
				</div>
				<div id="ApplyBody" class="modal-body">
					<div class="row">
						<label class="col-sm-2 control-label text-right">企业名称:</label>
						<label class="col-sm-4">{{apply.userName}}</label>
						<label style="display: none">{{apply.payerAccount}}</label>
						<label class="col-sm-2 control-label text-right">提现金额:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" name="money" data-title="提现金额" placeholder="提现金额" ng-model="apply.money">
						</div>
					</div>
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">付款方式:</label>
						<div class="col-sm-4">
							<select class="form-control require" name="method" data-title="请选择付款方式" ng-model="apply.method">
								<option value="">请选择付款方式</option>
								<!--<option value="01">支付宝</option>-->
								<!--<option value="02">财付通</option>-->
								<option value="3">银行转账</option>
								<!--<option value="04">现金</option>-->
							</select>
						</div>
						<label class="col-sm-2 control-label text-right">收款人账户:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" name="account" data-title="收款人账户" placeholder="收款人账户" ng-model="apply.account">
						</div>
					</div>
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">行别:</label>
						<div class="col-sm-4">
							<select class="form-control require" name="bank" data-title="行别" ng-model="apply.bank">
								<option value="">请选择行别</option>
								<option ng-repeat="item in banklist" value="{{item.bankCode}}">
									{{item.bankName}}
								</option>
							</select>
						</div>

						<label class="col-sm-2 control-label text-right">开户行:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" name="Kbank" data-title="开户行" placeholder="开户行" ng-model="apply.Kbank">
						</div>
					</div>
					<p></p>
					<div class="row">
						<label class="col-sm-2 control-label text-right">收款单位/个人:</label>
						<div class="col-sm-4">
							<input type="text" class="form-control require" name="info" data-title="收款单位/个人信息" placeholder="请输入收款单位/个人信息" ng-model="apply.info">
						</div>
						<label class="col-sm-2 control-label text-right">计划打款日期:</label>
						<div class="col-sm-4">
							<input type="text"   placeholder="计划打款日期 " data-title="计划打款日期" name="txdate" id="txdate" class="form-control require" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
						</div>
					</div>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" id="saveAppsub" class="btn btn-primary" ng-click="saveApplyCash()">确定</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
	</form>

	<form id="saveBackCash">
		<div class="modal fade" tabindex="-1" data-backdrop="static" id="backCash" role="dialog" aria-labelledby="gridSystemModalLabel">
			<div class="modal-dialog " role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title">冲销</h4>
					</div>
					<div class="modal-body">
						<div class="row">
							<label class="col-sm-3 control-label text-right">企业名称:</label>
							<label class="col-sm-6 control-label text-left">{{backCashInfo.companyName}}</label>
						</div>
						<p></p>
						<div class="row">
							<label class="col-sm-3 control-label text-right">交易类型:</label>
							<label class="col-sm-6 control-label text-left">冲销</label>
						</div>
						<p></p>
						<div class="row">
							<label class="col-sm-3 control-label text-right">冲销金额:</label>
							<div class="col-sm-6">
								<input type="text" class="form-control require number" data-max="{{backCashInfo.blance}}" data-maxtitle="不能大于余额" name="back" placeholder="必须<=账户余额{{backCashInfo.blance}}" data-title="冲销金额" ng-model="backCashInfo.back" ng-keyup="clearNoNum(backCashInfo,'back')">
							</div>
						</div>
						<p></p>
						<div class="row">
							<label class="col-sm-3 control-label text-right">冲销原因:</label>
							<div class="col-sm-6">
								<textarea class="form-control require" data-title="冲销原因" ng-model="backCashInfo.reson" placeholder="限30字" maxlength="30"></textarea>
							</div>
						</div>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" ng-click="baskCash()">确定</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
	</form>

</div><!-- /.wrapper-md -->